﻿import QtQuick 2.15
import QtQuick.Controls 2.15

/*
  IO监控界面
*/

Item {
    id:backGround
    width: screenWidth
    height: 1600

    Rectangle{
        anchors.fill: backGround
        color: "#00BFFF"
        border.width: 5
        border.color: "#F0F8FF"
    }

    onVisibleChanged: {
        if(visible === true)
        {
            Cpp_Connect.pageNumber = 11
        }
    }

    Rectangle{      // 输出信号
        anchors.horizontalCenter: backGround.horizontalCenter
        anchors.top: backGround.top
        color: "#00BFFF"
        border.width: 5
        border.color: "#F0F8FF"
        width: backGround.width
        height: 690

        Text{           // 区域标题 -- 输出信号
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.top: parent.top
            anchors.topMargin: 30
            font.pixelSize: 40
            font.bold: true
            color: "red"
            text:qsTr("输出信号")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 90
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y0 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y0")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 120
            anchors.top: parent.top
            anchors.topMargin: 110
            font.pixelSize: 30
            font.bold: true
            text:qsTr("脉  冲")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 190
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y1 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y1")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 120
            anchors.top: parent.top
            anchors.topMargin: 210
            font.pixelSize: 30
            font.bold: true
            text:qsTr("方  向")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 290
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y2 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y2")
            }
        }


        Text{
            anchors.left: parent.left
            anchors.leftMargin: 120
            anchors.top: parent.top
            anchors.topMargin: 310
            font.pixelSize: 30
            font.bold: true
            text:qsTr("左电机")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 390
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y3 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y3")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 120
            anchors.top: parent.top
            anchors.topMargin: 410
            font.pixelSize: 30
            font.bold: true
            text:qsTr("右电机")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 490
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y4 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y4")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 120
            anchors.top: parent.top
            anchors.topMargin: 510
            font.pixelSize: 30
            font.bold: true
            text:qsTr("左45度阀")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 590
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y5 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y5")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 120
            anchors.top: parent.top
            anchors.topMargin: 610
            font.pixelSize: 30
            font.bold: true
            text:qsTr("左90度阀")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 90
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y6 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y6")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 110
            font.pixelSize: 30
            font.bold: true
            text:qsTr("右45度阀")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 190
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y7 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y7")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 210
            font.pixelSize: 30
            font.bold: true
            text:qsTr("右90度阀")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 290
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y10 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y10")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 310
            font.pixelSize: 30
            font.bold: true
            text:qsTr("左工进")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 390
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y11 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y11")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 410
            font.pixelSize: 30
            font.bold: true
            text:qsTr("右工进")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 490
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y12 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y12")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 510
            font.pixelSize: 30
            font.bold: true
            text:qsTr("左压紧")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 590
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y13 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y13")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 610
            font.pixelSize: 30
            font.bold: true
            text:qsTr("右压紧")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 570
            anchors.top: parent.top
            anchors.topMargin: 90
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y14 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y14")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 660
            anchors.top: parent.top
            anchors.topMargin: 110
            font.pixelSize:30
            font.bold: true
            text:qsTr("料高气缸")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 570
            anchors.top: parent.top
            anchors.topMargin: 190
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y15 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y15")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 660
            anchors.top: parent.top
            anchors.topMargin: 210
            font.pixelSize:30
            font.bold: true
            text:qsTr("前托料架")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 570
            anchors.top: parent.top
            anchors.topMargin: 290
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y16 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y16")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 660
            anchors.top: parent.top
            anchors.topMargin: 310
            font.pixelSize:30
            font.bold: true
            text:qsTr("中托料架")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 570
            anchors.top: parent.top
            anchors.topMargin: 390
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y17 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y17")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 660
            anchors.top: parent.top
            anchors.topMargin: 410
            font.pixelSize:30
            font.bold: true
            text:qsTr("后托料架")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 570
            anchors.top: parent.top
            anchors.topMargin: 490
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y20 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y20")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 660
            anchors.top: parent.top
            anchors.topMargin: 510
            font.pixelSize:30
            font.bold: true
            text:qsTr("刹车气缸")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 570
            anchors.top: parent.top
            anchors.topMargin: 590
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y21 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y21")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 660
            anchors.top: parent.top
            anchors.topMargin: 610
            font.pixelSize:30
            font.bold: true
            text:qsTr("拽料气缸")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 840
            anchors.top: parent.top
            anchors.topMargin: 90
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_Y22 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("Y22")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 930
            anchors.top: parent.top
            anchors.topMargin: 110
            font.pixelSize:30
            font.bold: true
            text:qsTr("左拉压紧")
        }



        Rectangle{          // 左右吹气阀按钮
            anchors.right: parent.right
            anchors.rightMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 300
            width: 200
            height: 100
            radius: 10
            border.width: 1
            border.color: "#F0F8FF"
            color: Cpp_Connect.IO_Y25 ? "#ff3606" : "#006cee"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text:qsTr("左右吹气阀")
            }

            MouseArea{
                anchors.fill: parent

                onPressed: {
                    parent.forceActiveFocus()
                    // parent.color = "#ff3606"
                    Cpp_Connect.write_modbus_rtu_Coils("247","1");
                }

                onReleased: {
                    // parent.color = "#006cee"
                    Cpp_Connect.write_modbus_rtu_Coils("247","0");
                }
            }
        }

        Rectangle{          // 左拉料压紧按钮
            anchors.right: parent.right
            anchors.rightMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 500
            width: 200
            height: 100
            radius: 10
            border.width: 1
            border.color: "#F0F8FF"
            color: Cpp_Connect.IO_Y22 ? "#ff3606" : "#006cee"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("左拉料压紧")
            }

            MouseArea{
                anchors.fill: parent

                onPressed: {
                    parent.forceActiveFocus()
                    // parent.color = "#ff3606"
                    Cpp_Connect.write_modbus_rtu_Coils("173","1");
                }

                onReleased: {
                    // parent.color = "#006cee"
                    Cpp_Connect.write_modbus_rtu_Coils("173","0");
                }
            }
        }



    }

    Rectangle{      // 输入信号
        anchors.horizontalCenter: backGround.horizontalCenter
        anchors.top: backGround.top
        anchors.topMargin: 690
        color: "#00BFFF"
        border.width: 5
        border.color: "#F0F8FF"
        width: backGround.width
        height: 900

        Text{           // 区域标题 -- 输入信号
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.top: parent.top
            anchors.topMargin: 30
            font.pixelSize: 40
            font.bold: true
            color: "green"
            text:qsTr("输入信号")
        }


        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 90
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X0 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X0")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 120
            anchors.top: parent.top
            anchors.topMargin: 110
            font.pixelSize: 30
            font.bold: true
            text:qsTr("磁尺A相")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 190
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X1 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X1")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 120
            anchors.top: parent.top
            anchors.topMargin: 210
            font.pixelSize: 30
            font.bold: true
            text:qsTr("磁尺B相")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 290
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X2 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X2")
            }
        }


        Text{
            anchors.left: parent.left
            anchors.leftMargin: 120
            anchors.top: parent.top
            anchors.topMargin: 310
            font.pixelSize: 30
            font.bold: true
            text:qsTr("左机头旋转")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 390
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X3 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X3")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 120
            anchors.top: parent.top
            anchors.topMargin: 410
            font.pixelSize: 30
            font.bold: true
            text:qsTr("右机头旋钮")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 490
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X5 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X5")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 120
            anchors.top: parent.top
            anchors.topMargin: 510
            font.pixelSize: 30
            font.bold: true
            text:qsTr("急停按钮")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 590
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X6 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X6")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 120
            anchors.top: parent.top
            anchors.topMargin: 610
            font.pixelSize: 30
            font.bold: true
            text:qsTr("压紧按钮")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 30
            anchors.top: parent.top
            anchors.topMargin: 690
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X7 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X7")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 120
            anchors.top: parent.top
            anchors.topMargin: 710
            font.pixelSize: 30
            font.bold: true
            text:qsTr("工进按钮")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 90
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X10 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X10")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 110
            font.pixelSize: 30
            font.bold: true
            text:qsTr("锯片启停")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 190
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X11 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X11")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 210
            font.pixelSize: 30
            font.bold: true
            text:qsTr("原点复位")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 290
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.leftSawQW ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X12")
            }
        }


        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 310
            font.pixelSize: 30
            font.bold: true
            text:qsTr("左锯片后位")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 390
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.rightSawQW ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X13")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 410
            font.pixelSize: 30
            font.bold: true
            text:qsTr("右锯片后位")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 490
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.leftSawHW ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X14")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 510
            font.pixelSize: 30
            font.bold: true
            text:qsTr("左锯片前位")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 590
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.rightSawHW ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X15")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 610
            font.pixelSize: 30
            font.bold: true
            text:qsTr("右锯片前位")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 690
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X16 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X16")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 710
            font.pixelSize: 30
            font.bold: true
            text:qsTr("伺服报警")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 300
            anchors.top: parent.top
            anchors.topMargin: 790
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X17 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X17")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 390
            anchors.top: parent.top
            anchors.topMargin: 810
            font.pixelSize:30
            font.bold: true
            text:qsTr("伺服准备好")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 570
            anchors.top: parent.top
            anchors.topMargin: 90
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X20 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X20")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 660
            anchors.top: parent.top
            anchors.topMargin: 110
            font.pixelSize:30
            font.bold: true
            text:qsTr("X轴原点")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 570
            anchors.top: parent.top
            anchors.topMargin: 190
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X21 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X21")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 660
            anchors.top: parent.top
            anchors.topMargin: 210
            font.pixelSize:30
            font.bold: true
            text:qsTr("X轴正限位")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 570
            anchors.top: parent.top
            anchors.topMargin: 290
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X22 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X22")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 660
            anchors.top: parent.top
            anchors.topMargin: 310
            font.pixelSize:30
            font.bold: true
            text:qsTr("X轴负限位")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 570
            anchors.top: parent.top
            anchors.topMargin: 390
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X23 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X23")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 660
            anchors.top: parent.top
            anchors.topMargin: 410
            font.pixelSize:30
            font.bold: true
            text:qsTr("前托退到位")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 570
            anchors.top: parent.top
            anchors.topMargin: 490
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X24 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X24")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 660
            anchors.top: parent.top
            anchors.topMargin: 510
            font.pixelSize:30
            font.bold: true
            text:qsTr("中托退到位")
        }

        Rectangle{
            anchors.left: parent.left
            anchors.leftMargin: 570
            anchors.top: parent.top
            anchors.topMargin: 590
            width: 70
            height: 70
            radius: 70
            border.width: 1
            border.color: "black"
            color: Cpp_Connect.IO_X25 ?  "red" : "white"

            Text{
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                text: qsTr("X25")
            }
        }

        Text{
            anchors.left: parent.left
            anchors.leftMargin: 660
            anchors.top: parent.top
            anchors.topMargin: 610
            font.pixelSize:30
            font.bold: true
            text:qsTr("后托退到位")
        }

    }
}
